{{#index}}
<div class="main-content">
    <div class="div-title">生成代码</div>
    <form class="data-form">
        <div class="form-horizontal m-t">
            <div class="col-sm-12">
                <textarea class="sqlText" style="width: 100%;height: 230px;">${data.sql}</textarea>
            </div>
        </div>
        <div class="form-horizontal m-t">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">项目名</label>
                    <div class="col-sm-7">
                        <input type="text" name="projectName" class="form-control data-param" value="${data.projectName}"  required="required">
                    </div>
                </div>
            </div>

            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">包名</label>
                    <div class="col-sm-7">
                        <input type="text" name="packageName" class="form-control data-param" value="${data.packageName}"  required="required">
                    </div>
                </div>
            </div>
        </div>


        <div class="row">
            <div class="col-sm-12 code-action-div">
                <js>if(!data.hideBtn)</js>
                <js-code>
                    <button class= "btn btn-primary e-go-mysql" type="button" href="module/tableCreateCode/mysqlTable">mysql连接</button>
                </js-code>
                <button class= "btn btn-primary e-resolving" type="button">解析</button>
                <button class= "btn btn-primary e-downloadBase" type="button">下载基础框架</button>
                <button class= "btn btn-primary e-downloadBaseKey" type="button">获取基础框架下载key</button>
            </div>
        </div>
    </form>

    <div id="table-data" class="table-data" ></div>
</div>
{{/index}}

{{#mysqlTable}}
<div class="main-content">
    <div class="div-title">获取表</div>
    <form class="data-form">
        <div class="form-horizontal m-t">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">mysql ip地址</label>
                    <div class="col-sm-7">
                        <input type="text" name="host" class="form-control data-param e-bind" value="${data.host}" data-bind="data.host"  required="required">
                    </div>
                </div>
            </div>

            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">mysql 端口</label>
                    <div class="col-sm-7">
                        <input type="text" name="port" class="form-control data-param e-bind" value="${data.port}" data-bind="data.port"  required="required" digits=true min="0" max="65535">
                    </div>
                </div>
            </div>
        </div>

        <div class="form-horizontal m-t">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">mysql 账号</label>
                    <div class="col-sm-7">
                        <input type="text" name="user" class="form-control data-param e-bind" value="${data.user}" data-bind="data.user"  required="required">
                    </div>
                </div>
            </div>

            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">mysql 密码</label>
                    <div class="col-sm-7">
                        <input type="text" name="password" class="form-control data-param e-bind" value="${data.password}" data-bind="data.password"  required="required">
                    </div>
                </div>
            </div>
        </div>

        <div class="form-horizontal m-t">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">mysql 数据库</label>
                    <div class="col-sm-7">
                        <input type="text" name="database" class="form-control data-param e-bind" value="${data.database}" data-bind="data.database"  required="required">
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">node 服务端口</label>
                    <div class="col-sm-7">
                        <input type="text" name="nodePort" class="form-control data-param e-bind" value="${data.nodePort}" data-bind="data.nodePort"  required="required" digits=true min="0" max="65535">
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12 code-action-div">
                <button class= "btn btn-primary e-connection" type="button">显示表</button>
                <button class= "btn btn-primary e-download-node" type="button">下载node工具包</button>
            </div>
        </div>
    </form>
    <js>if(data.tables.length>0)</js>
    <js-code>
        <div class="data-table-show">
            <js>for(var i=0;i< data.tables.length;i++)</js>
            <js-code>
            <button class= "btn btn-primary e-getCreateTable" data="${data.tables[i].name}" type="button">${data.tables[i].name}(${data.tables[i].comment})</button>
            </js-code>
        </div>
    </js-code>


    <div id="main"></div>
</div>
{{/mysqlTable}}

{{#tableData}}
<div>
    <table class="code-table" border="1px">
<tr>
    <td colspan="10" style="text-align: center">类信息</td>
</tr>
<tr>
    <td>类名</td>
    <td><input type="text" class="input-text data-param" name="className" value="${data.className}" /></td>
    <td>表名</td>
    <td><input type="text" class="input-text data-param" name="tableName" value="${data.tableName}" /></td>
    <td >注释</td>
    <td colspan="5"><input type="text" name="desc" class="input-text data-param" value="${data.desc}"/></td>
</tr>
<tr>
    <td colspan="10" style="text-align: center">列信息</td>
</tr>
<tr>
    <td>字段名</td>
    <td>列名</td>
    <td>数据类型</td>
    <td>注释</td>
    <td>注释详情</td>
    <td>不为null</td>
    <td>查询字段</td>
    <td>保存字段</td>
    <td>更新字段</td>
    <td>默认当前时间</td>
</tr>
<js> var selectIndex=0;</js>
 <js>for(var i=0;i< data.fieldList.length;i++)</js>
    <js-code>
        <tr>
            <td><input type="text" class="input-text" id="column${i}" value="${data.fieldList[i].column}"/></td>
            <td><input type="text" class="input-text" id="name${i}" value="${data.fieldList[i].name}"/></td>
            <td><input type="text" class="input-text" id="type${i}" value="${data.fieldList[i].type}"/></td>
            <td><input type="text" class="input-text" id="desc${i}" value="${data.fieldList[i].desc}"/></td>
            <td><input type="text" class="input-text" id="descInfo${i}" value="${data.fieldList[i].descInfo}"/></td>
            <js>if(data.fieldList[i].notNull)</js>
            <js-code>
                <td><input type="checkbox" class="checkbox-1" id="notNullFlag{i}" name="notNullFlag" checked/></td>
            </js-code>
            <js>else</js>
            <js-code>
                <td><input type="checkbox" class="checkbox-1" id="notNullFlag{i}" name="notNullFlag"/></td>
            </js-code>

            <js>if(data.fieldList[i].id)</js>
            <js-code>
                <td><input type="checkbox" class="checkbox-1" id="selectFlag${i}" name="selectFlag"/></td>
                <td><input type="checkbox" class="checkbox-1" id="addFlag${i}"  name="addFlag" /></td>
                <td><input type="checkbox" class="checkbox-1" id="updateFlag${i}" name="updateFlag"/></td>
            </js-code>
            <js>else</js>
            <js-code>
                <js>if(data.fieldList[i].notNull&&selectIndex<5)</js>
                <js-code>
                    <js>selectIndex++;</js>
                    <td><input type="checkbox" class="checkbox-1" id="selectFlag${i}" name="selectFlag" checked/></td>
                </js-code>
                <js>else</js>
                <js-code>
                    <td><input type="checkbox" class="checkbox-1" id="selectFlag${i}" name="selectFlag"/></td>
                </js-code>
                <td><input type="checkbox" class="checkbox-1" id="addFlag${i}"  name="addFlag" checked/></td>
                <td><input type="checkbox" class="checkbox-1" id="updateFlag${i}" name="updateFlag" checked/></td>
            </js-code>

            <js>if(data.fieldList[i].name=="createDate")</js>
            <js-code>
                <td><input type="checkbox" class="checkbox-1" id="defaultDateFlag${i}" name="defaultDateFlag" checked/></td>
            </js-code>
            <js>else</js>
            <js-code>
                <td><input type="checkbox" class="checkbox-1" id="defaultDateFlag${i}" name="defaultDateFlag"/></td>
            </js-code>
        </tr>
    </js-code>
</table>
    <div class="checkbox-div">
        <div>基础框架：</div>
        基础框架：<input type="checkbox" class="checkbox-1 data-param"  name="baseProject" /><br>
    </div>

    <div class="checkbox-div checkbox-div-line">
        <div>功能生成选择：</div>
         分页查询：<input type="checkbox" class="checkbox-1 data-param"  name="findPage" checked/><br>
        批量删除：<input type="checkbox" class="checkbox-1 data-param"  name="batchDelete" checked/><br>
        导出excel：<input type="checkbox" class="checkbox-1 data-param"  name="export" checked/><br>
            新增：<input type="checkbox" class="checkbox-1 data-param"  name="add" checked/><br>
            删除：<input type="checkbox" class="checkbox-1 data-param"  name="delete" checked/><br>
            修改：<input type="checkbox" class="checkbox-1 data-param"  name="update" checked/><br>
            详情：<input type="checkbox" class="checkbox-1 data-param"  name="info" checked/><br>
    </div>
    <form class="data-form">
    <div class="row">
        <div class="col-sm-12 code-action-div">
            <div class="form-horizontal m-t">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">项目名</label>
                        <div class="col-sm-7">
                            <input type="text" name="projectName" class="form-control data-param" value="${data.projectName}"  required="required">
                        </div>
                    </div>
                </div>

                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">包名</label>
                        <div class="col-sm-7">
                            <input type="text" name="packageName" class="form-control data-param" value="${data.packageName}"  required="required">
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-sm-12 code-action-div">
            <button class= "btn btn-primary e-download" type="button">下载</button>
            <button class= "btn btn-primary e-download-key" type="button">获取下载key</button>
        </div>
    </div>
    </form>
</div>

{{/tableData}}